import java.awt.*;
import java.awt.event.InputEvent;

/**
 * 创建零一robot
 *移动鼠标并打开某个文件夹
 */
public class TestRobot {
    public static void main(String[] args) {
        try {
            Robot robot=new Robot();
            //确定鼠标位置
            robot.mouseMove(332,743);/*
            双击左键打开文件
            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);*/
               //按住鼠标右键操作
            robot.mousePress(InputEvent.BUTTON3_DOWN_MASK);
            //延时释放鼠标
            robot.delay(10000);
            //释放鼠标右键操作
            robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK);
        } catch (AWTException e) {
            throw new RuntimeException(e);
        }
    }
}
